package com.bestcem.xm.deliver.util;


import com.bestcem.xm.deliver.enums.DeliverSurveyDataSurveyStatusEnum;
import com.bestcem.xm.deliver.enums.RespondentStatusEnum;

import java.util.*;
import java.util.stream.Collectors;

import static com.bestcem.xm.deliver.enums.WechatMprecordStatusEnum.*;

/**
 * 常量类
 */
public interface DeliverConstant {
    List<String> IMG_LIST = Arrays.asList(
            "png",
            "jpeg",
            "jpg",
            "gif",
            "bmp",
            "tif",
            "pcx",
            "tga",
            "exif",
            "fpx",
            "psd",
            "cdr",
            "pcd",
            "dxf",
            "ufo",
            "eps",
            "ai",
            "raw",
            "wmf",
            "webp",
            "avif",
            "apng",
            "heif"
    );

    List<String> VIDEO_TYPE = Arrays.asList(
            "mp4",
            "mov",
            "wmv",
            "avi",
            "flv",
            "webm",
            "3gp",
            "asf",
            "asx",
            "rm",
            "rmvb",
            "m4v",
            "dat",
            "mkv",
            "vob"
    );


    List<String> AUDIO_TYPE = Arrays.asList("mp3", "wma", "wav", "amr", "m4a", "aac");

    List<String> EXCEL_LIST = Arrays.asList("xls", "xlsx", "csv");

    List<String> PDF_LIST = Collections.singletonList("pdf");

    Map<String, List<String>> TYPE_LIMIT_LIST = new HashMap<String, List<String>>() {
        {
            put("img", IMG_LIST);
            put("audio", AUDIO_TYPE);
            put("video", VIDEO_TYPE);
            put("excel", EXCEL_LIST);
            put("pdf", PDF_LIST);
        }
    };

    List<String> FULL_TYPE_LIST = new ArrayList<String>() {
        {
            addAll(IMG_LIST);
            addAll(VIDEO_TYPE);
            addAll(EXCEL_LIST);
            addAll(EXCEL_LIST);
            addAll(PDF_LIST);
        }
    };

    Map<String, String> DELIVER_EXCEL_MAP = new HashMap<String, String>() {{
        put("邮件投放名单模板", "emailDeliverTemplate");
        put("短信投放名单模板", "smsDeliverTemplate");
    }};

    String CODE_PREFIX = "AUTO_";
    String DELETE_IDS = "delete_ids";
    String NO_DISTURB_LIST = "no_disturb_list";
    String AUTO_ADD_DISTURB = "auto_add_disturb";
    String SURVEY_ID = "survey_id";
    String ID = "_id";
    List<String> RESPONDENT_STATUS =
            Arrays.asList(String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_BEGIN.getValue()),
                    String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_FINISH.getValue()),
                    String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_SCREEN_OUT.getValue()),
                    String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_QUOTA_FULL.getValue()),
                    String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_BACKUP.getValue()),
                    String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_OPEN.getValue()),
                    String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_UNFINISH.getValue()),
                    String.valueOf(RespondentStatusEnum.RESPONDENT_STATUS_NOTSTART.getValue()));


    Integer WECHATMP_SEND_STATUS_UNSPECIFIED = 0;
    Integer WECHATMP_SEND_STATUS_SENDING = 1;
    Integer WECHATMP_SEND_STATUS_SUCCESS = 2;
    Integer WECHATMP_SEND_STATUS_USER_BLOCK = 3;
    Integer WECHATMP_SEND_STATUS_FAILD = 4;

    Map<Integer, Integer> WECHATMP_SEND_STATUS_DICT = new HashMap<Integer, Integer>() {{
        put(WECHATMP_SEND_STATUS_UNSPECIFIED, WECHATMPRECORD_STATUS_FAILED.getValue());
        put(WECHATMP_SEND_STATUS_SENDING, WECHATMPRECORD_STATUS_SENDING.getValue());
        put(WECHATMP_SEND_STATUS_SUCCESS, WECHATMPRECORD_STATUS_SUCCESS.getValue());
        put(WECHATMP_SEND_STATUS_USER_BLOCK, WECHATMPRECORD_STATUS_USER_BLOCK.getValue());
        put(WECHATMP_SEND_STATUS_FAILD, WECHATMPRECORD_STATUS_FAILED.getValue());
    }};

    /**
     * oss临时文件过期时间 单位:秒
     * 5 * 60 = 300 s
     */
    long OSS_TEMP_EXPIRE_SECOND = 300;

    List<Integer> DELIVERSURVEYDATA_SURVEY_STATUS_LIST = Arrays.stream(DeliverSurveyDataSurveyStatusEnum.values()).map(DeliverSurveyDataSurveyStatusEnum::getValue).collect(Collectors.toList());

    /**
     * 投放mq size大小
     */
    Integer DELIVER_MQ_BATCH_SIZE = 5000;

    // 定制参数配置
    /*List<String> HONDA_PIDS = Arrays.asList(
            "5e018e98aace70000a88790a",
            "5e00a4fcaace70000a699561",
            "5e16e15caace70000a46b69f",
            "5e05e65caace700009c5d47a",
            "5e5db9dfaace7000093d789d",
            "5e61b10aaace7000098f247e"
    );*/

    /**
     * 验证状态【0：未验证、1：验证通过、2：验证失败，default:0】
     */
    Integer SMTP_VALIDATE_STATUS_VERIFYSUCCESS = 1;


    /**
     * 超时时间
     */
    String MAIL_SMTP_TIMEOUT = "mail.smtp.timeout";
    /**
     * 验证
     */
    String MAIL_SMTP_AUTH = "mail.smtp.auth";
    /**
     * 类
     */
    String MAIL_SMTP_SOCKETFACTORY_CLASS = "mail.smtp.socketFactory.class";
    /**
     * 端口
     */
    String MAIL_SMTP_SOCKETFACTORY_PORT = "mail.smtp.socketFactory.port";

    String SMS_SIGN = "【倍市得CEM】";

    String SMS_SUBCODE = "2155131";

    /**
     * balance免费余额 单位 分
     */
    Map<Integer, Integer> EDITION_BALANCE_DICT = new HashMap<Integer, Integer>() {
        {
            put(0, 1000);
            put(1, 1000);
        }
    };
}
